using System;
using System.Collections.Generic;
using UnityEngine;

namespace PhysSound
{
	[Serializable]
	public class PhysSoundAudioSet
	{
		public int Key;

		public List<AudioClip> Impacts = new List<AudioClip>();

		public AudioClip Slide;

		public AudioClip GetImpact(float vel, bool random)
		{
			if (Impacts.Count == 0)
			{
				return null;
			}
			if (random)
			{
				return Impacts[UnityEngine.Random.Range(0, Impacts.Count)];
			}
			int index = (int)(vel * (float)(Impacts.Count - 1));
			return Impacts[index];
		}

		public bool CompareKeyIndex(int k)
		{
			return Key == k;
		}
	}
}
